package com.lipengcheng.search.web;

import com.lipengcheng.feign.common.dto.PageDTO;
import com.lipengcheng.search.pojo.ItemDOC;
import com.lipengcheng.search.pojo.RequestParams;
import com.lipengcheng.search.service.SearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.io.IOException;

@RestController
@RequestMapping("search")
public class SearchController {
    @Autowired
    private SearchService searchService;

    //根据搜索条件搜索文档
    @PostMapping("/list")
    public PageDTO<ItemDOC> list(@RequestBody RequestParams param)  {
        PageDTO<ItemDOC> pageDTO=searchService.page(param);
        return pageDTO;
    }

}
